﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="socialnexus.admin.Users.Default"
    MasterPageFile="~/masters/Admin.Master" %>

<asp:Content ContentPlaceHolderID="body" runat="server">

<h1>Social Nexus Users</h1>

<p><asp:HyperLink runat="server" NavigateUrl="~/admin/Users/Add.aspx" Text="Add User" /></p>

<table class="genericTable" cellpadding="0" cellspacing="1" border="0">
<asp:Repeater ID="rptrUsers" runat="server">
    <HeaderTemplate>
        <tr>
            <th>&nbsp;</th>
            <th>First Name</th>
            <th>Last Name</th>
            <th>Username</th>
            <th>Active</th>
            <th class="actions">Actions</th>
        </tr>
    </HeaderTemplate>
    <ItemTemplate>
        <tr>
        <td>
            <asp:HyperLink ID="HyperLink2" NavigateUrl='<%# "Show.aspx?UserId="+DataBinder.Eval(Container.DataItem, "SiteUserId").ToString() %>'
                runat="server">
                <asp:Image runat="server" ID="PictureURL" AlternateText="Picture"
                    ImageUrl='<%# DataBinder.Eval(Container.DataItem, "PictureURL").ToString().Trim() %>' />
            </asp:HyperLink>    
        </td>
        <td><asp:Label runat="server" ID="FirstName" 
            Text='<%# DataBinder.Eval(Container.DataItem, "FirstName") %>' /></td>
        <td><asp:Label runat="server" ID="LastName" 
            Text='<%# DataBinder.Eval(Container.DataItem, "LastName") %>' /></td>
        <td><asp:Label runat="server" ID="Label1" 
            Text='<%# DataBinder.Eval(Container.DataItem, "Username") %>' /></td>
        <td><%# DataBinder.Eval(Container.DataItem, "IsActive").ToString() %></td>
        <td>
            <asp:HyperLink ID="lnkEdit" NavigateUrl='<%# "Edit.aspx?UserId="+DataBinder.Eval(Container.DataItem, "SiteUserId").ToString() %>'
                Text="Edit" runat="server" />
            <asp:HyperLink ID="lnkSuspend" NavigateUrl='<%# "Suspend.aspx?UserId="+DataBinder.Eval(Container.DataItem, "SiteUserId").ToString() %>'
                Text="Suspend" runat="server" Visible='<%# DataBinder.Eval(Container.DataItem, "IsActive").ToString() == "True" %>' />
            <asp:HyperLink ID="lnkActivate" NavigateUrl='<%# "Activate.aspx?UserId="+DataBinder.Eval(Container.DataItem, "SiteUserId").ToString() %>'
                Text="Activate" runat="server" Visible='<%# DataBinder.Eval(Container.DataItem, "IsActive").ToString() == "False" %>' />
        </td>
        </tr>
    </ItemTemplate>
</asp:Repeater>
</table>

</asp:Content>
